home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <memory.h>
- #include <devices.h>
- #include <files.h>
- #include <errors.h>
-
- #include <sys/types.h>
- #include <sys/socket.h> /* for AF_INET */
- #include <netdb.h>
- #include <arpa/inet.h>
- #include <netinet/in.h>
-
-
- char *h_errlist[] = {
- "Error 0",
- "Unknown host", /* 1 HOST_NOT_FOUND */
- "Host name lookup failure", /* 2 TRY_AGAIN */
- "Unknown server error", /* 3 NO_RECOVERY */
- "No address associated with name", /* 4 NO_ADDRESS */
- };
- int h_nerr = { sizeof(h_errlist)/sizeof(h_errlist[0]) };
-
- extern int h_errno;
-
- herror(s)
- char *s;
- {
- dprintf("%s: ",s);
- if (h_errno < h_nerr)
- dprintf(h_errlist[h_errno]);
- else
- dprintf("error %d",h_errno);
- dprintf("\n");
- }
-
- main(argc,argv)
- int argc;
- char *argv[];
- {
- char name[256];
-
- (void) getdomainname(name,255);
- }
-
-